package com.lmoumou.lib_comment

import android.os.Build
import java.util.*

/**
 * 作者：Lmoumou
 * 时间：2020/9/7 15:55
 */
object AppHelper {
    fun getUniquePsuedoID(): String {

        val m_szDevIDShort: String =
            "35" + (Build.BOARD.length % 10) + (Build.BRAND.length % 10) + (Build.CPU_ABI.length % 10) + (Build.DEVICE.length % 10) + (Build.MANUFACTURER.length % 10) + (Build.MODEL.length % 10) + (Build.PRODUCT.length % 10)
        val serial: String? = try {
            android.os.Build::class.java.getField("SERIAL").get(null).toString()
        } catch (e: Exception) {
            e.printStackTrace()
            "serial" // some value
        }

        return "${UUID(m_szDevIDShort.hashCode().toLong(), serial.hashCode().toLong())}"
    }
}